package com.ciwong.epaper.widget;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.me.bean.BookmarkBean;


/**
 * Created by keepon on 2018/8/7.
 */
public class ExpansionItemView extends BaseNewBookItemInView<BookmarkBean> {


    public ExpansionItemView(Context context) {
        super(context);
    }

    public void bindData(BookmarkBean bookmarkBean) {
        try {
            if (bookmarkBean.getIconUrl() != null) {
                Glide.with(getContext()).load(bookmarkBean.getIconUrl()).placeholder(R.mipmap.icon_book_mark_default).into(mIvIcon);
            } else {
                if (0 == bookmarkBean.getLoaclIcon()) {
                    mIvIcon.setImageResource(R.mipmap.icon_book_mark_default);
                } else {
                    mIvIcon.setImageResource(bookmarkBean.getLoaclIcon());
                }
            }
        } catch (Exception e) {

        } catch (OutOfMemoryError error) {

        }
        mTvName.setText(bookmarkBean.getBookmarkName());
    }
}
